package chapter11.Enum.HomeWork;

/**
 * @Auther: Tx
 * @Date: 2022/5/3 16:24
 */


public class HomeWork01 {
    public static void main(String[] args) {
     Color color= Color.RED;
     color.show();
     switch (color){
         case RED:
             System.out.println("红色");
             break;
         case BLUE:
             System.out.println("蓝色");
             break;
         case BLACK:
             System.out.println("黑色");
             break;
     }
    }
}

interface Interface{
    void show();
}
enum Color implements Interface{
    RED(255,0,0),BLUE(0,0,255)
    ,BLACK(0,0,0),YELLOW(255,255,0)
    ,GREEN(0,255,0);
    private int redValue;
    private int greenValue;
    private int blueValue;

    Color(int redValue, int greenValue, int blueValue) {
        this.redValue = redValue;
        this.greenValue = greenValue;
        this.blueValue = blueValue;
    }

    @Override
    public void show() {
        System.out.println("R "+redValue+"G "+greenValue+"B "+blueValue);
    }
}